1. Field of the Invention
The present invention relates to a displacement measuring device and a displacement measuring method. Specifically, the present invention relates to a technique for measuring relative displacement of a movable element to a fixed element based on a detection signal which varies according to the relative displacement.
2. Description of Related Art
There have been known a displacement measuring device which detects displacement of a movable element to a fixed element, which is called an encoder (for example, JPH06-064100B, JP2909338B, JP2878913B, and JP2738996B). Encoders have been used for displacement detectors of small measuring devices, such as digital vernier calipers, digital micrometers, and digital indicators, and widely utilized to position moving tables or the like.
Encoders are, for example, optical encoders, capacitive encoders, and magnetic encoders. A capacitive encoder will be exemplified. Note that, an optical encoder and a magnetic encoder are essentially the same as a capacitive encoder in detection principle. A capacitive encoder includes a main scale and a detection head, which is relatively movable to the main scale and detects relative displacement to the main scale. Generally. the main scale is a fixed element and the detection head is a movable element, but they may be reversed. A number of electrodes are disposed on the main scale and the detection head. A periodic capacity change is generated in electrode patterns according to the relative displacement between the main scale and detection head. By extracting the signal of the periodic capacity change, the displacement is detected.
The periodic signal generated at the electrodes, that is, a phase signal is extracted. The phase signal is extracted as a periodic square wave signal CMP by performing sampling, mixing, low-frequency filtering, or binarizing. The periodic square wave signal CMP has phase information at edges thereof. A phase detection circuit outputs the phase information of the square wave signal CMP as a digital value. For example, if a loop counter counts up according to a clock and the count value is sampled at the timing of edges of the square wave signal CMP, the phase information is thus extracted as a digital value. Then, by comparing the phase information with an electrode arrangement pitch, the phase information is converted into the relative displacement of the detection head. By sampling the phase information as a digital value a predetermined number of times, averaging processing may be performed to reduce display flicker or to cancel offsets of an amplifier or a comparator.